<template>
	<MyPage title="账单详情" :isback="true">
		<view slot="gBody">
			<view class="bill-top">
				<view class="title">{{info.title}}</view>
				<view class="price">{{info.price}}</view> 
			</view>
			<view class="bill-card">
				<u-cell-item :arrow="false" title="交易方式" :value="info.type"></u-cell-item>
				<u-cell-item :arrow="false" title="交易时间" :value="info.time"></u-cell-item>
				<u-cell-item :arrow="false" title="交易单号" :value="info.number"></u-cell-item> 
			</view>
			<!--<view class="bill-card"></view>-->
		</view>
	</MyPage>
</template>		

<script>
import mixin from "@/libs/mixin.js";
export default {
	//mixins: [mixin],
	data() {
		return {
			info: {
				title: '百策充值100元',
				price: '100.00',
				state: '充值成功',
				type: '微信',
				time: '2021-08-05 15:10:25',
				number: '10050202021512000',
				from: '北京恒银科技有限公司'
			}
		}
	},
	onLoad(option) {
		if(!this.$store.state.app.token){
			this.$utils.redirectTo('/pages/login/login',{
				title:"登录",
				subTitle:"请先登录",
				btnValue:"请先登录",
				url:'/login/login'
			});
		}else{
			this.getData(option.id);
		}
		// 获取数据
		 
	},
	methods: {
		// 获取数据
		getData(id){
			uni.request({
				url: 'http://www.txzh.com.cn/api.php?app=Default&act=getBilldetail',  
				method: 'POST',
				header: {
						'Content-Type': 'application/x-www-form-urlencoded',
						'X-Requested-With': 'xmlhttprequest'
				},
				data:{
					token:this.$store.state.app.token,
					id:id
				},
				success: res => {
				  this.info = res.data.list
				},  
				fail: () => {},  
				complete: () => {}  
			});  
		}
	}
}
</script>

<style lang="scss">
page{
	background:#f3f3f3;
}
</style>
<style lang="scss" scoped>
.bill-top{
	padding: 60rpx 0 30rpx;
	text-align: center;
	.title{
		font-size:32rpx;
	}
	.price{
		margin-top:12rpx;
		font-size:46rpx;
	}
	.state{
		margin-top:30rpx;
	}
}
.bill-card{
	margin:18rpx 40rpx 0;
	padding:15rpx 40rpx;
	border-radius: 20rpx;
	background: #fff;
	/deep/ .u-cell{
		padding:15rpx 0;
		.u-cell_title{
			color: #333;
		}
		&:last-child:after{
			border:none;
		}
	}
}
</style>